<?php
$filename	=$_FILES['importfile']['name'];
$tmpname	=$_FILES['importfile']['tmp_name'];
$pat=$filename;
if(@copy($tmpname, $pat)) 
{	

?>
<script type='text/javascript'>alert('Import Sukses!');
window.location.href='<?=base_url();?>/index.php/backup_database/';
</script>";
<?
}
else
{
echo "<script type='text/javascript'>alert('Gagal di import!');
window.history.back(-1);
</script>";
}

//include ("ClassSQLimport.php");
require_once APPPATH.'libraries/MySQL_import.php';
$check = false;
$database = 'bp3ti';
$host = "localhost";
$dbUser = "root";
$dbPassword = "";
$sqlFile = $filename;

$newImport = new sqlImport($sqlFile, $check, $host, $dbUser, $dbPassword, $database);
$newImport -> import ();

@unlink($pat);

?> 